package com.example.androidproject.api

import android.content.Context
import com.android.baselibrary.app.MainApplication
import com.cms.breakpad.NativeLib
import com.cms.crash.handler.CustomActivityOnCrash
import com.cms.crash.handler.CustomCrashHandler
import com.cms.hotfix.utils.EnjoyFix
import com.cms.hotfix.utils.HotFixJavaUtils
import com.cms.skin.SkinManager
import dagger.hilt.android.HiltAndroidApp
import java.io.File

//import com.cms.startup.StartupManager
//import com.example.androidproject.startup.InitSdkOne

@HiltAndroidApp
class CustomApplication:MainApplication() {
    override fun onCreate() {
        super.onCreate()
       CustomActivityOnCrash.install(this)
        SkinManager.instance.install(this)
       // HotFixJavaUtils.inject(this,"/storage/hotfix.jar")
      //  StartupManager.Builder().addStartup(InitSdkOne()).build(this).start()
 NativeLib().initContext(this)

    }

    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
       // EnjoyFix.installPatch(this, File("/sdcard/hotfix.jar"))
        HotFixJavaUtils.inject(this,"/sdcard/hotfix.jar")
    }
}